package com.jt.www.admin.order_pc.service;

import com.github.pagehelper.PageInfo;
import com.jt.www.domain.po.ApplicationFileInfoEntity;
import com.jt.www.domain.vo.EduPolicyBean;
import com.jt.www.domain.vo.EduPolicyVO;
import com.jt.www.model.Insurancedata.MyPageInfo;
import com.jt.www.model.param.endorse.AppDetailProParam;
import com.jt.www.model.remote.ins.EduPolicyStatisticsVo;
import com.jt.www.model.remote.ins.InsManagerResultVO;
import com.jt.www.model.reps.ResponseData;
import com.jt.www.model.vo.*;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Auther: shalongteng
 * @Date: 2019-06-19
 * @Description:
 */
@Service
public interface ApplicationFormService {
    /**
     * 查询投保单列表
     *
     * @param insManagerQo
     * @return
     */
    ResponseData findApplicationForm(InsManagerQo insManagerQo, String findCode, boolean isDown) throws Exception;


    /**
     * 查询投保单列表-添加用户权限
     *
     * @param insManagerQo
     * @return
     */
    boolean findApplicationFormAddUserInfo(InsManagerQo insManagerQo, String findCode) throws Exception;

    /**
     * 查询投保单列表-查询列表不用考虑用户权限
     *
     * @param insManagerQo
     * @return
     */
    ResponseData findApplicationFormHasUserInfo(InsManagerQo insManagerQo, String findCode, boolean isDown) throws Exception;

    /*
     *  统计投保单金额以及人数
     * @Author xq.wu
     * @Date 13:46 2020/4/16
     * @Param [insManagerQo, findCode]
     * @return com.jt.www.model.remote.ins.EduPolicyStatisticsVo
     **/
    EduPolicyStatisticsVo statisticsAppilications(InsManagerQo insManagerQo, String findCode) throws Exception;


    /**
     * 下载
     *
     * @param insManagerQo
     * @return
     * @throws Exception
     */
    List<InsManagerResultVO> downAppList(InsManagerQo insManagerQo, String findCode) throws Exception;

    /**
     * 下载投保单生成PDF文件
     *
     * @param applicationFormCode 投保单号
     * @throws Exception
     */
    void downAppFormToPDF(String applicationFormCode) throws Exception;

    /*
     *  生成投保单预览页面
     * @Author xq.wu
     * @Date 16:09 2019/12/6
     * @Param [param]
     * @return void
     **/
    void downAppFormPdf(AppDetailProParam param, Model model, HttpServletRequest request, HttpServletResponse response) throws Exception;

    /**
     * 在线查询
     *
     * @param eduPolicyBean
     * @return
     * @throws Exception
     */
    MyPageInfo<EduPolicyVO> onlineQuery(EduPolicyBean eduPolicyBean) throws Exception;

    ResponseData getBackPolicyNoError(AppDetailProParam param) throws Exception;

    /**
     * 查询投保单列表(案件关联保单时使用)
     *
     * @param appForCaseQo
     * @return
     * @throws Exception
     */
    MyPageInfo<AppForCaseVO> appilicationsForCase(AppForCaseQo appForCaseQo) throws Exception;

    /**
     * 查询被保险人信息(案件关联保单时使用)
     *
     * @param insuredForCaseQo
     * @return
     * @throws Exception
     */
    InsuredForCaseVO insuredForCase(InsuredForCaseQo insuredForCaseQo) throws Exception;

    /**
     * 返回补录结果vo
     *
     * @param excelFile
     * @return
     */
    PostRecordedVo postRecorded(MultipartFile excelFile);

    /**
     * 根据投保单号查询流水号
     *
     * @param appCode
     * @return
     * @throws Exception
     */
    String selectSerialNoByAppCode(String appCode) throws Exception;

    /**
     * 根据投保单号查询报文错误原因
     *
     * @param applicationFormCode
     * @return
     * @throws Exception
     */
    ResponseData getErrorIssue(String applicationFormCode) throws Exception;

    /*
     *  查询报文重发列表
     * @Author xq.wu
     * @Date 10:21 2019/10/25
     * @Param [issueRetransQo, findCode]
     * @return org.springframework.http.ResponseEntity<com.jt.www.model.reps.GenericListResponse<com.jt.www.model.remote.ins.IssueRetransResultVO>>
     **/
    PageInfo findIssueList(IssueRetransQo issueRetransQo) throws Exception;

    /**
     * 保存投保单清单文件信息
     *
     * @param entities
     * @return
     */
    ResponseEntity<?> saveApplicationFileInfo(List<ApplicationFileInfoEntity> entities) throws Exception;

    /**
     * 根据投保单号查询已上传清单人数总和
     *
     * @param applicationFormCode
     * @return
     * @throws Exception
     */
    ResponseEntity<?> getInsuredNumByAppCode(String applicationFormCode) throws Exception;
}
